/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved. ProjectName: qolome-knowledge FileName: Gper.java
 * Author: jiangfeng@qolome.com Date: 2020/3/27 下午8:31 LastModified: 2020/03/27 20:31:27
 */

package com.qolome.knowledge.design.pattern.observer.demo.gper;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.util.Observable;

/**
 * @author Qolome
 * @version V1.0
 * @Description 咕泡
 * @date 2020年 03月27日 20:31:28
 */
@Slf4j
@Data
public class Gper extends Observable {

    private String name = "Gper生态圈";
    private static final Gper gper = new Gper();

    private Gper() {}

    public static Gper getInstance() {
        return gper;
    }

    public void pulishQuestion(Question question) {

        log.info("提问者{}提出问题:{}", question.getStudentName(), question.getStudentName());
        setChanged();
        notifyObservers(question);
    }

}
